package com.share.device.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.share.common.core.annotation.Excel;
import com.share.common.core.web.domain.BaseEntity;

import java.util.Date;

/**
 * 工单信息对象
 * 
 * @author         
 * @date 2025-06-29
 */
@Data
@Schema(description = "工单信息对象")
public class WorkOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 工单ID */
    @Schema(description = "工单ID")
    private Integer orderId;

    /** 工单类型 */
    @Excel(name = "工单类型", readConverterExp = "repair=维修,maintain=维护,inspect=检查,refill=补充")
    @Schema(description = "工单类型")
    private String orderType;

    /** 关联设备ID */
    @Excel(name = "关联设备ID")
    @Schema(description = "关联设备ID")
    private Integer deviceId;

    /** 关联站点ID */
    @Excel(name = "关联站点ID")
    @Schema(description = "关联站点ID")
    private Integer siteId;

    /** 上报人ID */
    @Excel(name = "上报人ID")
    @Schema(description = "上报人ID")
    private Integer reporterId;

    /** 处理人ID */
    @Excel(name = "处理人ID")
    @Schema(description = "处理人ID")
    private Integer assigneeId;

    /** 问题描述 */
    @Excel(name = "问题描述")
    @Schema(description = "问题描述")
    private String description;

    /** 优先级 */
    @Excel(name = "优先级", readConverterExp = "low=低,medium=中,high=高,urgent=紧急")
    @Schema(description = "优先级")
    private String priority;

    /** 工单状态 */
    @Excel(name = "工单状态", readConverterExp = "pending=待处理,processing=处理中,completed=已完成,closed=已关闭")
    @Schema(description = "工单状态")
    private String status;

    /** 完成时间 */
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "完成时间")
    private Date completeTime;

    /** 关联设备信息 */
    @TableField(exist = false)
    @Schema(description = "关联设备信息")
    private Device device;

    /** 关联站点信息 */
    @TableField(exist = false)
    @Schema(description = "关联站点信息")
    private Station site;

    /** 上报人信息 */
    @TableField(exist = false)
    @Schema(description = "上报人信息")
    private Personnel reporter;

    /** 处理人信息 */
    @TableField(exist = false)
    @Schema(description = "处理人信息")
    private Personnel assignee;

    /** 关联机柜信息 */
    @TableField(exist = false)
    @Schema(description = "关联机柜信息")
    private Cabinet cabinet;

    public void setOrderId(Integer orderId) 
    {
        this.orderId = orderId;
    }

    public Integer getOrderId() 
    {
        return orderId;
    }

    public void setOrderType(String orderType) 
    {
        this.orderType = orderType;
    }

    public String getOrderType() 
    {
        return orderType;
    }

    public void setDeviceId(Integer deviceId) 
    {
        this.deviceId = deviceId;
    }

    public Integer getDeviceId() 
    {
        return deviceId;
    }

    public void setSiteId(Integer siteId) 
    {
        this.siteId = siteId;
    }

    public Integer getSiteId() 
    {
        return siteId;
    }

    public void setReporterId(Integer reporterId) 
    {
        this.reporterId = reporterId;
    }

    public Integer getReporterId() 
    {
        return reporterId;
    }

    public void setAssigneeId(Integer assigneeId) 
    {
        this.assigneeId = assigneeId;
    }

    public Integer getAssigneeId() 
    {
        return assigneeId;
    }

    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }

    public void setPriority(String priority) 
    {
        this.priority = priority;
    }

    public String getPriority() 
    {
        return priority;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public void setCompleteTime(Date completeTime) 
    {
        this.completeTime = completeTime;
    }

    public Date getCompleteTime() 
    {
        return completeTime;
    }

    public void setDevice(Device device) 
    {
        this.device = device;
    }

    public Device getDevice() 
    {
        return device;
    }

    public void setSite(Station site) 
    {
        this.site = site;
    }

    public Station getSite() 
    {
        return site;
    }

    public void setReporter(Personnel reporter) 
    {
        this.reporter = reporter;
    }

    public Personnel getReporter() 
    {
        return reporter;
    }

    public void setAssignee(Personnel assignee) 
    {
        this.assignee = assignee;
    }

    public Personnel getAssignee() 
    {
        return assignee;
    }

    public void setCabinet(Cabinet cabinet) {
        this.cabinet = cabinet;
    }

    public Cabinet getCabinet() {
        return cabinet;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("orderId", getOrderId())
            .append("orderType", getOrderType())
            .append("deviceId", getDeviceId())
            .append("siteId", getSiteId())
            .append("reporterId", getReporterId())
            .append("assigneeId", getAssigneeId())
            .append("description", getDescription())
            .append("priority", getPriority())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("completeTime", getCompleteTime())
            .toString();
    }
} 